/**
 * 3D模型查看器样式
 */

.model-viewer-container {
  width: 100%;
  position: relative;
}

.model-canvas-wrapper {
  width: 100%;
  height: clamp(350px, 60vh, 500px);
  min-height: 350px;
  position: relative;
  background: linear-gradient(135deg, #f5f0e8 0%, #faf8f3 100%);
  border-radius: clamp(12px, 2vw, 16px);
  overflow: hidden;
  touch-action: none;
  margin-bottom: clamp(15px, 3vw, 20px);
  
  canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: clamp(12px, 2vw, 16px);
  }
}

/* 小程序环境的 Canvas 容器 */
.model-canvas-wrapper-mini {
  width: 100%;
  height: clamp(350px, 60vh, 500px);
  min-height: 350px;
  position: relative;
  background: linear-gradient(135deg, #f5f0e8 0%, #faf8f3 100%);
  border-radius: clamp(12px, 2vw, 16px);
  overflow: hidden;
  margin-bottom: clamp(15px, 3vw, 20px);
}

.model-canvas-mini {
  width: 100%;
  height: 100%;
  display: block;
}

.model-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(139, 69, 19, 0.2);
  border-top-color: #B8956A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 14px;
  color: #666;
}

.model-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.error-text {
  font-size: 16px;
  color: #ff4444;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}

.model-tips {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.tip-item {
  font-size: 12px;
  color: #999;
  padding: 6px 12px;
  background: rgba(139, 69, 19, 0.05);
  border-radius: 12px;
}

/* 小程序占位符 */
.model-placeholder-simple {
  width: 100%;
  min-height: clamp(350px, 60vh, 500px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(30px, 6vw, 40px) clamp(20px, 4vw, 20px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.5vw, 15px);
  margin-bottom: clamp(15px, 3vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.placeholder-icon {
  font-size: clamp(60px, 12vw, 80px);
}

.placeholder-title {
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 600;
  color: #B8956A;
  line-height: 1.3;
}

.placeholder-hint {
  font-size: clamp(13px, 2.8vw, 14px);
  color: #999;
  line-height: 1.6;
  max-width: 80%;
}

.placeholder-cube {
  margin-top: clamp(20px, 4vw, 30px);
  width: clamp(120px, 25vw, 150px);
  height: clamp(120px, 25vw, 150px);
  perspective: 600px;
}

.cube-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateCube 10s infinite linear;
}

@keyframes rotateCube {
  from {
    transform: rotateX(0deg) rotateY(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

.cube-face-3d {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 2px solid #B8956A;
  background: rgba(139, 69, 19, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #B8956A;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.front  { transform: rotateY(0deg) translateZ(75px); }
.back   { transform: rotateY(180deg) translateZ(75px); }
.right  { transform: rotateY(90deg) translateZ(75px); }
.left   { transform: rotateY(-90deg) translateZ(75px); }
.top    { transform: rotateX(90deg) translateZ(75px); }
.bottom { transform: rotateX(-90deg) translateZ(75px); }

